<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Hugo 0.82.0" />


<title>How to Install xRDP Server on Ubuntu 20.04 - 宇飞的世界</title>
<meta property="og:title" content="How to Install xRDP Server on Ubuntu 20.04 - 宇飞的世界">


  <link href='/favicon.ico' rel='icon' type='image/x-icon'/>



  








<link href='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css' rel='stylesheet' type='text/css' />



<link rel="stylesheet" href="/css/fonts.css" media="all">
<link rel="stylesheet" href="/css/main.css" media="all">



  </head>
  <body>
    <div class="wrapper">
      <header class="header">
        <nav class="nav">
  <a href="/" class="nav-logo">
    <img src="/images/logo.png"
         width="50"
         height="50"
         alt="Logo">
  </a>

  <ul class="nav-links">
    
    <li><a href="/about/">About</a></li>
    
    <li><a href="/categories/">Categories</a></li>
    
    <li><a href="/tags/">Tags</a></li>
    
    <li><a href="http://www.zhongyufei.com/Rbook/_book">R study</a></li>
    
  </ul>
</nav>

      </header>


<main class="content" role="main">

  <article class="article">
    
    <span class="article-duration">1 min read</span>
    

    <h1 class="article-title">How to Install xRDP Server on Ubuntu 20.04</h1>

    
    <span class="article-date">2021-04-30</span>
    

    <div class="article-content">
      <h2 id="installing-desktop-environment">Installing desktop environment</h2>
<p>First, we need to provide our Ubuntu server system with a desktop environment. Let’s install Gnome in this example.</p>
<pre><code>sudo apt update

apt install ubuntu-desktop

</code></pre><h2 id="installing-and-configuring-xrdp">Installing and configuring xRDP</h2>
<p>To install xRDP package, run:</p>
<pre><code>apt install xrdp

</code></pre><p>You also need to grant access to the /etc/ssl/private/ssl-cert-snakeoil.key file for xrdp user. It is available to members of the ssl-cert group by default.</p>
<pre><code>adduser xrdp ssl-cert

</code></pre><p>Restart the service.</p>
<pre><code>systemctl restart xrdp

</code></pre><h2 id="firewall-configuration">Firewall configuration</h2>
<p>You need to open access on port 3389.</p>
<pre><code>ufw allow 3389
</code></pre><p>It is more secure to open it only for your IP address or network. For example:</p>
<pre><code>ufw allow from 10.5.5.0/24 to any port 3389
</code></pre><p>The best practice is to use an SSH tunnel to connect to the remote desktop and make xRDP listen only for local connections.</p>
<h2 id="xrdp-connection-to-ubuntu-server-2004">xRDP connection to Ubuntu server 20.04</h2>
<p>Please note that the user who will connect to xRDP must log out before doing so!</p>
<p>It’s time to establish an xRDP connection to your Ubuntu server.
Connect to your server using any RDP client.</p>
<p><img src="https://gitee.com/zhongyufei/photo-bed/raw/pic/img/%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_16197674198087.png" style="zoom:50%;" /></p>

    </div>
  </article>

  


</main>

      <footer class="footer">
        <ul class="footer-links">
          <li>
            <a href="/index.xml" type="application/rss+xml" target="_blank">RSS feed</a>
          </li>
          <li>
            <a href="https://beian.miit.gov.cn/" target="_blank">粤ICP备20035539号</a>
          </li>
        </ul>
      </footer>

    </div>
    



<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>



<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/r.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/yaml.min.js"></script>
<script>hljs.configure({languages: []}); hljs.initHighlightingOnLoad();</script>



    

    
  </body>
</html>

